#ifndef PRODLGHEAD_H_PPOUNNCMBQQ
#define PRODLGHEAD_H_PPOUNNCMBQQ

#include <QWidget>
#include <QPaintEvent>
#include <QFont>
#include <QPointF>


#include "ProtactorToolView.h"

namespace kepen {
namespace core {

class ProDlgHead : public QWidget
{
    Q_OBJECT
public:
    ProDlgHead(QWidget *parent,ProtactorToolView *parentContext,int width);
    ~ProDlgHead();
    bool eventFilter(QObject *watched, QEvent *event) override;
protected:
    void leaveEvent(QEvent *) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void paintEvent(QPaintEvent *) override;

private:
    int getGridWidth(int length,const int *param, int *cellWidthArr);
    int getIdOfTouched(const QPointF &point ,int &comboBoxFlag);
    void onPaintButtons(QPainter *painter);
    void getBtnPosition(int id,QPoint &point);
private:

    ProtactorToolView *editContext;
    bool isMouseLeftDown,isWindowDeactivate;
    int  m_nIdTouchedDown,m_nIdMouseOver,m_nLengthMenu;
    int comboBoxFlagLast;


    int *idMenuArray;
    int *cellWidthArr;
    QPointF ptDown;
};

}
}
#endif // PRODLGHEAD_H
